package com.linewow.xhyy.nihaonew.entity.tag;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * Created by LXR on 2016/8/30.
 */
public class TagListInfo implements Parcelable {


    /**
     * tagid : 9
     * hash : 20160301153402.jpg
     * color : #FF0000
     * zh-cn : 吃货
     * en : Chowhound
     * width : 545
     * height : 300
     */

    public String tagid;
    public String hash;
    public String color;
    public String en;
    public String width;
    public String height;
    @SerializedName("zh-cn")
    public String zhcn;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.tagid);
        dest.writeString(this.hash);
        dest.writeString(this.color);
        dest.writeString(this.en);
        dest.writeString(this.width);
        dest.writeString(this.height);
        dest.writeString(this.zhcn);
    }

    public TagListInfo() {
    }

    protected TagListInfo(Parcel in) {
        this.tagid = in.readString();
        this.hash = in.readString();
        this.color = in.readString();
        this.en = in.readString();
        this.width = in.readString();
        this.height = in.readString();
        this.zhcn = in.readString();
    }

    public static final Parcelable.Creator<TagListInfo> CREATOR = new Parcelable.Creator<TagListInfo>() {
        @Override
        public TagListInfo createFromParcel(Parcel source) {
            return new TagListInfo(source);
        }

        @Override
        public TagListInfo[] newArray(int size) {
            return new TagListInfo[size];
        }
    };

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TagListInfo that = (TagListInfo) o;

        return zhcn.equals(that.zhcn);

    }

    @Override
    public int hashCode() {
        return zhcn.hashCode();
    }

    public void setZhcn(String zhcn) {
        this.zhcn = zhcn;
    }

    public void setEn(String en) {
        this.en = en;
    }

    public void setTagid(String tagid) {
        this.tagid = tagid;
    }
}
